package com.gzedu.ecloud.common.utils;

import java.io.Serializable;

public class Result implements Serializable {

	private static final long serialVersionUID = 8187491195721763013L;
	private int ret;
	private String msg;
	private Object data;
	private long total;

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	private final static int suc = 0;
	private final static int fail = 1;

	public static Result suc() {
		Result result = new Result();
		result.setRet(suc);
		result.setMsg("");
		return result;
	}

	public static Result suc(Object data) {
		Result result = new Result();
		result.setRet(suc);
		result.setMsg("");
		result.setData(data);
		return result;
	}

	public static Result error(String msg) {
		Result result = new Result();
		result.setRet(fail);
		result.setMsg(msg);
		return result;
	}

	public int getRet() {
		return ret;
	}

	public void setRet(int ret) {
		this.ret = ret;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public static int getSuc() {
		return suc;
	}

}
